const { Schema, SchemaTypes } = require('../schema');
const ConsumerStatus = require('../../module/const/ConsumerStatus');
/**
 * 用户消费
 */
class PromoteConsume extends Schema {
    PropertyModelDataTemplate () {
        return {
            userId: { type: SchemaTypes.ObjectId, required: true },

            // 订单id
            orderId: { type: SchemaTypes.ObjectId, required: false },
            // 消耗数量
            consumerCount: { type: SchemaTypes.Number, required: true },
            // 消耗类型
            consumerType: { type: SchemaTypes.Number, required: true },
            // 状态
            consumerStatus: { type: SchemaTypes.Number, required: true, default: ConsumerStatus.normal },

            // 区域id
            areaId: { type: SchemaTypes.ObjectId, required: true },
            createTime: { type: SchemaTypes.Number, required: true, default: require('../../module/tool/time').getCurrentTimestamp() }
        };
    }
}

module.exports = PromoteConsume;
